package models

import (
	"github.com/goravel/framework/database/orm"
)

type Category struct {
	orm.Model
	Biz         string     `json:"biz"`
	Name        string     `json:"name"`
	ParentId    int        `json:"parent_id"`
	OrderNum    int        `json:"order_num"`
	Status      int        `json:"status"`
	CreatorId   int        `json:"creator_id"`
	CreatorName string     `json:"creator_name"`
	Children    []Category `json:"children,omitempty" gorm:"foreignKey:parent_id"`
}

func NewCategory() *Category {
	return &Category{}
}

func (Category) TableName() string {
	return "category"
}
